Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempt to fix one reactive test failing intermittently on Windows #967

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Sep 10, 2024

The weekly scheduled job has been failing intermittently over the last months due to one reactive test failing on Windows.

================================== FAILURES ===================================
_________________________ test_reactive_gen_with_dep __________________________

    async def test_reactive_gen_with_dep():
        def gen(i):
            yield i+1
            time.sleep(0.05)
            yield i+2
    
        irx = rx(0)
        rxgen = rx(bind(gen, irx))
        assert rxgen.rx.value is param.Undefined
        await asyncio.sleep(0.04)
        assert rxgen.rx.value == 1
        irx.rx.value = 3
        await asyncio.sleep(0.04)
>       assert rxgen.rx.value == 4
E       assert 5 == 4
E        +  where 5 = <param.reactive.reactive_ops object at 0x0000020D4E3FE450>.value
E        +    where <param.reactive.reactive_ops object at 0x0000020D4E3FE450> = <param.reactive.rx object at 0x0000020D4E3FE540>.rx

tests\testreactive.py:621: AssertionError
=========================== short test summary info ===========================
FAILED tests/testreactive.py::test_reactive_gen_with_dep - assert 5 == 4
 +  where 5 = <param.reactive.reactive_ops object at 0x0000020D4E3FE450>.value
 +    where <param.reactive.reactive_ops object at 0x0000020D4E3FE450> = <param.reactive.rx object at 0x0000020D4E3FE540>.rx
============ 1 failed, 1403 passed, 5 skipped, 2 xfailed in 20.62s ============

On a Windows machine, I tried increasing the sleep time in the generator from 0.04 to 0.1 second and it seems it did the trick. I can't say I fully understand what's going on in this test though 🙃

@philippjfr philippjfr merged commit 0d191dc into main Oct 8, 2024
11 checks passed
@philippjfr philippjfr deleted the fix_reactive_gen_test_windows branch October 8, 2024 09:28
@hoxbro hoxbro mentioned this pull request Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants